import request from '@/utils/request'
import { help } from 'runjs'

//查询审批种类
export function fetchKind() {
  return request({
    url: '/administration/administration/kind',
    method: 'get'
  })
}

// 查询审批管理列表
export function listAdministration(query) {
  return request({
    url: '/administration/administration/list',
    method: 'get',
    params: query
  })
}

// 查询审批管理详细
export function getAdministration(id) {
  return request({
    url: '/administration/administration/' + id,
    method: 'get'
  })
}

// 新增审批管理
export function addAdministration(data) {
  return request({
    url: '/administration/administration',
    method: 'post',
    data: data
  })
}

export function addAdministration1(data) {
  return request({
    url: '/administration/administration/addAdministration',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function updatefilePath(id, formData) {
  return request({
    url: `/administration/administration/filePath/${id}`,
    method: 'put',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data' // 必须设置这个头部才能上传文件
    }
  })
}

// 修改审批管理
export function updateAdministration(data) {
  return request({
    url: '/administration/administration',
    method: 'put',
    data: data
  })
}

// 删除审批管理
export function delAdministration(id) {
  return request({
    url: '/administration/administration/' + id,
    method: 'delete'
  })
}


// 删除审批管理
export function logicDelAdministration(ids) {
  return request({
    url: '/administration/administration/deleteLogic/' + ids,
    method: 'post'
  })
}

